Current Location: Home> Function Categories> log

log

Natural logarithm
Name:log
Category:math
Programming Language:php
One-line Description:Natural logarithm.

Definition and usage

log() returns natural logarithm.

Example

 <?php
echo lcg_value ( ) ;
?>

Try it yourself

grammar

 log ( x , base )
parameter describe
x Required. A number.
base Optional. If this parameter is specified, log base x is returned.

illustrate

If an optional parameter base is specified, log() returns log base x , otherwise log() returns the natural logarithm of parameter x .

Note: The parameter base is available since PHP 4.3.0. You can calculate any logarithm with n based on b, but in fact, you use the mathematical equation: logb(n) = log(n)/log(b), where log is a natural logarithm.

Similar Functions
  • Ancient sine asin

    asin

    Ancientsine
  • Returns log(1 + number), and can calculate the exact result even when the value of number is close to zero. log1p

    log1p

    Returnslog(1+number)
  • Find the maximum value max

    max

    Findthemaximumvalue
  • Returns the remainder of the floating point number of division fmod

    fmod

    Returnstheremaindero
  • Convert decimal to octal decoct

    decoct

    Convertdecimaltoocta
  • Generate better random numbers mt_rand

    mt_rand

    Generatebetterrandom
  • Antihyperbolic tangent atanh

    atanh

    Antihyperbolictangen
  • Tilt tan

    tan

    Tilt
Popular Articles